<!DOCTYPE html>
<html lang="en" xmlns:v-on="http://www.w3.org/1999/xhtml">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
</head>
<body>
<div id="msg">
    <button @click="start">开始滚动</button>
    <br>
    <button @click="stop">停止</button>
    <br>
    <!--<h1>{{message}}</h1>-->
    <h1><span v-html="message"></span></h1>
</div>
</body>
<script src="./node_modules/vue/dist/vue.js"></script>
<script type="text/javascript">

    let msg = new Vue({
        el: "#msg",
        data: {
            message: "0123456789",
            interval: null
        },
        methods: {
            start(){
                this.interval = setInterval(()=> {
                    let begin = this.message.substring(0, 1);
                    let end = this.message.substring(1);
                    this.message = end + begin;
                }, 50);
            },
            stop(){
                clearInterval(this.interval);
            }
        }
    });

</script>
</html>